package com.ruoyi.system.service.impl;

import java.util.List;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.EquipmentMaintenanceRecordMapper;
import com.ruoyi.system.domain.EquipmentMaintenanceRecord;
import com.ruoyi.system.service.IEquipmentMaintenanceRecordService;
import com.ruoyi.common.core.text.Convert;

/**
 * 设备维护信息Service业务层处理
 * 
 * @author 管鸿影
 * @date 2024-12-08
 */
@Service
public class EquipmentMaintenanceRecordServiceImpl extends ServiceImpl<EquipmentMaintenanceRecordMapper,EquipmentMaintenanceRecord> implements IEquipmentMaintenanceRecordService

{
    @Autowired
    private EquipmentMaintenanceRecordMapper equipmentMaintenanceRecordMapper;

    /**
     * 查询设备维护信息
     * 
     * @param maintenanceId 设备维护信息主键
     * @return 设备维护信息
     */
    @Override
    public EquipmentMaintenanceRecord selectEquipmentMaintenanceRecordByMaintenanceId(Long maintenanceId)
    {
        return equipmentMaintenanceRecordMapper.selectEquipmentMaintenanceRecordByMaintenanceId(maintenanceId);
    }

    /**
     * 查询设备维护信息列表
     * 
     * @param equipmentMaintenanceRecord 设备维护信息
     * @return 设备维护信息
     */
    @Override
    public List<EquipmentMaintenanceRecord> selectEquipmentMaintenanceRecordList(EquipmentMaintenanceRecord equipmentMaintenanceRecord)
    {
        return equipmentMaintenanceRecordMapper.selectEquipmentMaintenanceRecordList(equipmentMaintenanceRecord);
    }

    /**
     * 新增设备维护信息
     * 
     * @param equipmentMaintenanceRecord 设备维护信息
     * @return 结果
     */
    @Override
    public int insertEquipmentMaintenanceRecord(EquipmentMaintenanceRecord equipmentMaintenanceRecord)
    {
        equipmentMaintenanceRecord.setCreateTime(DateUtils.getNowDate());
        return equipmentMaintenanceRecordMapper.insertEquipmentMaintenanceRecord(equipmentMaintenanceRecord);
    }

    /**
     * 修改设备维护信息
     * 
     * @param equipmentMaintenanceRecord 设备维护信息
     * @return 结果
     */
    @Override
    public int updateEquipmentMaintenanceRecord(EquipmentMaintenanceRecord equipmentMaintenanceRecord)
    {
        equipmentMaintenanceRecord.setUpdateTime(DateUtils.getNowDate());
        return equipmentMaintenanceRecordMapper.updateEquipmentMaintenanceRecord(equipmentMaintenanceRecord);
    }

    /**
     * 批量删除设备维护信息
     * 
     * @param maintenanceIds 需要删除的设备维护信息主键
     * @return 结果
     */
    @Override
    public int deleteEquipmentMaintenanceRecordByMaintenanceIds(String maintenanceIds)
    {
        return equipmentMaintenanceRecordMapper.deleteEquipmentMaintenanceRecordByMaintenanceIds(Convert.toStrArray(maintenanceIds));
    }

    /**
     * 删除设备维护信息信息
     * 
     * @param maintenanceId 设备维护信息主键
     * @return 结果
     */
    @Override
    public int deleteEquipmentMaintenanceRecordByMaintenanceId(Long maintenanceId)
    {
        return equipmentMaintenanceRecordMapper.deleteEquipmentMaintenanceRecordByMaintenanceId(maintenanceId);
    }
}
